emacs.git
2 years ago(rmail-font-lock-keywords): Avoid old-style `font-lock*-face` variables
Stefan Monnier [Fri, 23 Feb 2024 16:31:43 +0000 (11:31 -0500)]
(rmail-font-lock-keywords): Avoid old-style `font-lock*-face` variables

* lisp/mail/rmail.el (rmail-font-lock-keywords): Refer directly to the
font-lock faces.

2 years agoWarn about docstrings with control characters
Mattias Engdegård [Fri, 23 Feb 2024 12:57:04 +0000 (13:57 +0100)]
Warn about docstrings with control characters

It is easy to include control chars in doc strings by mistake, and the
result is often an unreadable mess.

* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types)
(byte-compile-warnings, byte-compile--docstring-style-warn):
Add `docstrings-control-chars` warning.
* etc/NEWS: Announce.

2 years agoReplace use of obsolete eshell-kill-output in test
Mattias Engdegård [Fri, 23 Feb 2024 12:14:18 +0000 (13:14 +0100)]
Replace use of obsolete eshell-kill-output in test

* test/lisp/eshell/eshell-tests.el (eshell-test/flush-output):
Use eshell-delete-output instead of eshell-kill-output.

2 years agoUpdate NEWS and manual after obarray changes
Mattias Engdegård [Sat, 17 Feb 2024 12:27:25 +0000 (13:27 +0100)]
Update NEWS and manual after obarray changes

* doc/lispref/abbrevs.texi (Abbrev Tables):
* doc/lispref/symbols.texi (Creating Symbols):
* doc/lispref/objects.texi (Type Predicates): Update text for obarray
now being an opaque type.
* etc/NEWS: Announce.

2 years agoUse the new obarray type for the initial obarray
Mattias Engdegård [Sun, 11 Feb 2024 14:11:21 +0000 (15:11 +0100)]
Use the new obarray type for the initial obarray

This can improve performance a lot, especially after the obarray has
been fed many symbols.

* src/lread.c (OBARRAY_SIZE): Remove.
(load_path_check): Create an obarray object instead of a vector.

2 years agoAdd a proper type for obarrays
Mattias Engdegård [Sat, 10 Feb 2024 20:14:09 +0000 (21:14 +0100)]
Add a proper type for obarrays

The new opaque type replaces the previous use of vectors for obarrays.
`obarray-make` now returns objects of this type.  Functions that take
obarrays continue to accept vectors for compatibility, now just using
their first slot to store an actual obarray object.

obarray-size and obarray-default-size now obsolete.

* lisp/obarray.el (obarray-default-size, obarray-size):
Declare obsolete.
(obarray-make, obarrayp, obarray-clear): Remove from here.
* src/fns.c (reduce_emacs_uint_to_hash_hash): Remove from here.
* src/lisp.h (struct Lisp_Obarray, OBARRAYP, XOBARRAY, CHECK_OBARRAY)
(make_lisp_obarray, obarray_size, check_obarray)
(obarray_iter_t, make_obarray_iter, obarray_iter_at_end)
(obarray_iter_step, obarray_iter_symbol, DOOBARRAY, knuth_hash): New.
(reduce_emacs_uint_to_hash_hash): Moved here.
* src/lread.c (check_obarray): Renamed and reworked as...
(checked_obarray_slow): ...this.
(intern_sym, Funintern, oblookup, map_obarray)
(Finternal__obarray_buckets): Adapt to new type.
(obarray_index, allocate_obarray, make_obarray, grow_obarray)
(obarray_default_bits, Fobarray_make, Fobarrayp, Fobarray_clear): New.
* etc/emacs_lldb.py (Lisp_Object):
* lisp/emacs-lisp/cl-macs.el (`(,type . ,pred)):
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types):
* lisp/emacs-lisp/comp-common.el (comp-known-type-specifiers):
* lisp/emacs-lisp/comp.el (comp-known-predicates):
* src/alloc.c (cleanup_vector, process_mark_stack):
* src/data.c (Ftype_of, syms_of_data):
* src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
* src/pdumper.c (dump_obarray_buckets, dump_obarray, dump_vectorlike):
* src/print.c (print_vectorlike_unreadable):
* test/lisp/abbrev-tests.el (abbrev-make-abbrev-table-test):
* test/lisp/obarray-tests.el (obarrayp-test)
(obarrayp-unchecked-content-test, obarray-make-default-test)
(obarray-make-with-size-test):
Adapt to new type.

2 years agoAdd obarray-clear and use it
Mattias Engdegård [Sun, 11 Feb 2024 17:30:22 +0000 (18:30 +0100)]
Add obarray-clear and use it

* lisp/obarray.el (obarray-clear): New.
* lisp/abbrev.el (clear-abbrev-table):
* lisp/vc/vc.el (vc-clear-context): Use it instead of assuming the
obarray is a vector that can be 0-filled.
* test/lisp/obarray-tests.el (obarray-clear): New test.

2 years agoUse obarrayp, not vectorp, to detect obarrays
Mattias Engdegård [Sat, 10 Feb 2024 19:59:42 +0000 (20:59 +0100)]
Use obarrayp, not vectorp, to detect obarrays

* lisp/abbrev.el (abbrev--active-tables):
* lisp/mail/mailabbrev.el (mail-abbrevs-setup, build-mail-abbrevs)
(define-mail-abbrev, mail-resolve-all-aliases)
(mail-abbrev-insert-alias):
* lisp/mail/rmail.el (rmail-resend):
* lisp/minibuffer.el (completion-table-with-context):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
(etags--xref-apropos-additional):
Use obarrayp as predicate for obarrays.

2 years agoUse obarray-make instead of make-vector to create obarrays
Mattias Engdegård [Thu, 8 Feb 2024 17:23:00 +0000 (18:23 +0100)]
Use obarray-make instead of make-vector to create obarrays

This prepares for the introduction of an actual obarray type.

* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-dynamic-map)
(semantic-lex-spp-dynamic-map-stack, semantic-lex-make-spp-table):
* lisp/cedet/semantic/lex.el (semantic-lex-make-keyword-table)
(semantic-lex-make-type-table):
* lisp/completion.el (cmpl-prefix-obarray, cmpl-obarray)
(clear-all-completions):
* lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info):
* lisp/emacs-lisp/eldoc.el (eldoc-message-commands)
(eldoc-edit-message-commands):
* lisp/mail/mail-extr.el (mail-extr-all-top-level-domains):
* lisp/mail/rmailkwd.el (rmail-label-obarray):
* lisp/net/dns.el (dns-cache):
* lisp/net/eww.el (eww-suggested-uris):
* lisp/net/imap.el (imap-open, imap-mailbox-select-1)
(imap-message-copyuid-1, imap-message-appenduid-1):
* lisp/obsolete/pgg.el (pgg-passphrase-cache, pgg-pending-timers):
* lisp/play/cookie1.el (cookie-cache):
* lisp/progmodes/cc-defs.el (c-lang-constants, c-define-lang-constant):
* lisp/progmodes/cc-langs.el (c-keywords-obarray):
* lisp/vc/vc-hooks.el (vc-file-prop-obarray):
* test/lisp/obarray-tests.el (obarrayp-test):
* test/src/minibuf-tests.el (minibuf-tests--strings-to-obarray):
Use obarray-make instead of obarray-make.

2 years ago* src/pdumper.c (dump_subr): Rename 'native_comp' -> 'non_primitive'.
Andrea Corallo [Fri, 23 Feb 2024 00:07:46 +0000 (01:07 +0100)]
* src/pdumper.c (dump_subr): Rename 'native_comp' -> 'non_primitive'.

2 years ago* src/fns.c (sxhash_bignum): Include sign bit in hash.
Mattias Engdegård [Fri, 23 Feb 2024 10:26:45 +0000 (11:26 +0100)]
* src/fns.c (sxhash_bignum): Include sign bit in hash.

2 years ago* src/fns.c (hash_string): Suppress warning on 32-bit platforms
Mattias Engdegård [Thu, 22 Feb 2024 19:15:33 +0000 (20:15 +0100)]
* src/fns.c (hash_string): Suppress warning on 32-bit platforms

Remove a shift-too-wide complaint by GCC in code that is never reached
on platforms where that shift is too wide.

2 years agoTone down python-mode warning to a simple message (bug#68559)
Mattias Engdegård [Thu, 22 Feb 2024 16:20:58 +0000 (17:20 +0100)]
Tone down python-mode warning to a simple message (bug#68559)

* lisp/progmodes/python.el
(python-shell-completion-native-turn-on-maybe):
There is no need for an alarming warning when using an inferior Python
without GNU readline; a calm message will do.

2 years agoFix bug#69140
Po Lu [Fri, 23 Feb 2024 02:18:17 +0000 (10:18 +0800)]
Fix bug#69140

* src/window.c (grow_mini_window): Don't adjust frame matrices
or force redisplay if the provided window cannot be
resized.  (bug#69140)

2 years ago* Fix 'parse-colon-path' entry in 'comp-known-type-specifiers'
Andrea Corallo [Thu, 22 Feb 2024 19:40:57 +0000 (20:40 +0100)]
* Fix 'parse-colon-path' entry in 'comp-known-type-specifiers'

* lisp/emacs-lisp/comp-common.el (comp-known-type-specifiers): Fix
'parse-colon-path'.

2 years ago* lisp/help-fns.el (describe-mode-outline): New user option (bug#64684).
Juri Linkov [Thu, 22 Feb 2024 17:38:17 +0000 (19:38 +0200)]
* lisp/help-fns.el (describe-mode-outline): New user option (bug#64684).

(describe-mode, describe-mode--minor-modes): Use 'describe-mode-outline'.

* lisp/help-mode.el (help-setup-xref): After disabling outline-minor-mode
also kill all outline-related local variables.  So that they won't affect
the output of other help commands in the same help buffer.

2 years agoRecognize functions and macros as defuns in 'cmake-ts-mode'
Jörg Bornemann [Sat, 17 Feb 2024 20:18:02 +0000 (21:18 +0100)]
Recognize functions and macros as defuns in 'cmake-ts-mode'

* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--function-name):
Renamed to 'cmake-ts-mode--defun-name' since the function handles
now functions and macros.
(cmake-ts-mode--defun-name): Return text of the first 'argument'
node below 'function_def' and 'macro_def' nodes.
(cmake-ts-mode): Set up treesit-defun-type-regexp and
'treesit-defun-name-function'.  Change the imenu setup to
recognize macros too.  Since we have set up
'treesit-defun-name-function', we don't have to
pass 'cmake-ts-mode--function-name' anymore.  (Bug#69186)

To make `treesit-defun-at-point' work properly, we have to recognize
function_def/macro_def nodes, not the lower-level *_command nodes.

2 years ago; Insert missing JNI prologues
Po Lu [Thu, 22 Feb 2024 05:30:18 +0000 (13:30 +0800)]
; Insert missing JNI prologues

* src/android.c (shouldForwardMultimediaButtons)
(shouldForwardCtrlSpace, notifyPixelsChanged, setupSystemThread):

* src/androidvfs.c (safSyncAndReadInput, safSync, safPostRequest)
(ftruncate): Insert absent JNI prologues.

2 years ago; * admin/CPP-DEFINES: Fix typos.
Po Lu [Thu, 22 Feb 2024 02:21:12 +0000 (10:21 +0800)]
; * admin/CPP-DEFINES: Fix typos.

2 years ago; * admin/CPP-DEFINES: Update with Android defines.
Po Lu [Thu, 22 Feb 2024 02:08:12 +0000 (10:08 +0800)]
; * admin/CPP-DEFINES: Update with Android defines.

2 years agoEnable inotify on systems with inotify_init yet no init1 variant
Po Lu [Thu, 22 Feb 2024 01:53:48 +0000 (09:53 +0800)]
Enable inotify on systems with inotify_init yet no init1 variant

* configure.ac (HAVE_INOTIFY): Check for the presence of
inotify_init in addition to inotify_init1.

* src/inotify.c (Finotify_add_watch): Implement with
inotify_init if inotify_init1 is absent.

2 years ago; * lisp/emacs-lisp/comp-run.el: Fix typo.
Andrea Corallo [Wed, 21 Feb 2024 20:38:11 +0000 (21:38 +0100)]
; * lisp/emacs-lisp/comp-run.el: Fix typo.

2 years ago* lisp/emacs-lisp/comp.el (comp--compute-function-types): Fix missing doc.
Andrea Corallo [Wed, 21 Feb 2024 16:45:41 +0000 (17:45 +0100)]
* lisp/emacs-lisp/comp.el (comp--compute-function-types): Fix missing doc.

2 years ago; Fix mid-symbol updating/cycling completion preview
Eshel Yaron [Thu, 1 Feb 2024 11:30:24 +0000 (12:30 +0100)]
; Fix mid-symbol updating/cycling completion preview

This fixes an issue where 'completion-preview-next-candidate'
would fail to take into account the part of the symbol that
follows point (the suffix) when point is at the middle of a
symbol, as well as a similar issue in 'completion-preview--show'
that would manifest with slow 'completion-at-point-functions'.

* lisp/completion-preview.el (completion-preview-next-candidate)
(completion-preview--show): Ensure that the completion preview
remains at the end of a symbol, when updating it while point is
in the middle of that symbol.

* test/lisp/completion-preview-tests.el
(completion-preview-mid-symbol-cycle): New test.  (Bug#68875)

2 years ago; Update URL of the tree-sitter-lua grammar
john muhl [Wed, 21 Feb 2024 16:14:05 +0000 (10:14 -0600)]
; Update URL of the tree-sitter-lua grammar

* admin/notes/tree-sitter/build-module/build.sh:
* lisp/progmodes/lua-ts-mode.el:
* test/infra/Dockerfile.emba: Use the new URL.  (bug#69304)

2 years ago; Add two comments on comp-known-predicates cl-deftype-satisfies
Andrea Corallo [Wed, 21 Feb 2024 14:45:40 +0000 (15:45 +0100)]
; Add two comments on comp-known-predicates cl-deftype-satisfies

* lisp/emacs-lisp/comp.el (comp-known-predicates): Add comment.
* lisp/emacs-lisp/cl-macs.el: Likewise.

2 years ago* Add few missing entries in 'comp-known-predicates'
Andrea Corallo [Wed, 21 Feb 2024 14:45:10 +0000 (15:45 +0100)]
* Add few missing entries in 'comp-known-predicates'

* lisp/emacs-lisp/comp.el (comp-known-predicates): Add framep, markerp,
number-or-marker-p, overlayp, processp, subrp and windowp and sort it
alphabetically.

2 years ago* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Rename constructors.
Andrea Corallo [Wed, 21 Feb 2024 14:06:18 +0000 (15:06 +0100)]
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Rename constructors.

2 years ago; * lisp/emacs-lisp/comp.el (native-comp-debug): Fix spacing.
Andrea Corallo [Wed, 21 Feb 2024 10:18:28 +0000 (11:18 +0100)]
; * lisp/emacs-lisp/comp.el (native-comp-debug): Fix spacing.

2 years ago* Make 'comp--compute-function-types' a pass
Andrea Corallo [Wed, 21 Feb 2024 10:18:06 +0000 (11:18 +0100)]
* Make 'comp--compute-function-types' a pass

* lisp/emacs-lisp/comp.el (comp-passes): Add comp--compute-function-types.
(comp--compute-function-types): New function.
(comp--compute-function-type): Move it.
(comp--final): Update it.

2 years agoRemove redundant call to 'eln_load_path_final_clean_up'
Eli Zaretskii [Wed, 21 Feb 2024 15:16:45 +0000 (17:16 +0200)]
Remove redundant call to 'eln_load_path_final_clean_up'

* src/emacs.c (shut_down_emacs): Remove redundant call to
'eln_load_path_final_clean_up'.  We call it from 'kill-emacs'
right before the call to 'exit'.

2 years ago; * src/lisp.h: Add Lisp_Object tagging scheme overview
Mattias Engdegård [Wed, 21 Feb 2024 14:22:21 +0000 (15:22 +0100)]
; * src/lisp.h: Add Lisp_Object tagging scheme overview

2 years agoSet tty mode to raw when setting up Inferior Python
kobarity [Fri, 16 Feb 2024 13:52:06 +0000 (22:52 +0900)]
Set tty mode to raw when setting up Inferior Python

* lisp/progmodes/python.el (python-shell-setup-code): New constant.
(python-shell-comint-watch-for-first-prompt-output-filter): Send
`python-shell-setup-code' to the Inferior Python process.
* test/lisp/progmodes/python-tests.el (python-ffap-module-path-1):
Eliminate skipping on Mac. (Bug#68559)

2 years ago* java/org/gnu/emacs/EmacsContextMenu.java (display): Reduce timeout.
Po Lu [Wed, 21 Feb 2024 13:49:35 +0000 (21:49 +0800)]
* java/org/gnu/emacs/EmacsContextMenu.java (display): Reduce timeout.

2 years ago* lisp/emacs-lisp/map.el (map--make-pcase-bindings): Fix use in Emacs<30
Stefan Monnier [Wed, 21 Feb 2024 13:49:15 +0000 (08:49 -0500)]
* lisp/emacs-lisp/map.el (map--make-pcase-bindings): Fix use in Emacs<30

2 years agoWork around premature dismissals of submenus under Android
Po Lu [Wed, 21 Feb 2024 03:49:47 +0000 (11:49 +0800)]
Work around premature dismissals of submenus under Android

* java/org/gnu/emacs/EmacsContextMenu.java (display): If between
HONEYCOMB and N, set wasSubmenuSelected.

2 years agoDo not attempt to check declarations in lock files
Jonas Bernoulli [Tue, 20 Feb 2024 21:49:07 +0000 (22:49 +0100)]
Do not attempt to check declarations in lock files

* lisp/emacs-lisp/check-declare.el (check-declare-directory): Do
not attempt to check declarations in lock files.  (Bug#69084)

2 years agoAllow trivially autoloading uses of transient's define macros
Jonas Bernoulli [Tue, 20 Feb 2024 17:49:20 +0000 (18:49 +0100)]
Allow trivially autoloading uses of transient's define macros

Since 49e41991b2f transient-define-prefix itself was autoloaded, but
that meant that when ever an autoload file was loaded, which contained
an autoload for a command defined using that macro, transient itself
had to be loaded.

That shouldn't be necessary.  For commands using these macros, an
autoload that is identical to what would have been generated if it
had been defined using defun, works just fine.

* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Allow uses of
transient-define-prefix, transient-define-suffix,
transient-define-infix and transient-define-argument
to be autoloaded using just ";;;autoload".

* lisp/transient.el (transient-define-prefix): No longer autoload.

2 years ago* Fix missing entry in 'cl--typeof-types'
Andrea Corallo [Tue, 20 Feb 2024 18:47:29 +0000 (19:47 +0100)]
* Fix missing entry in 'cl--typeof-types'

* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add
'native-comp-unit'.

2 years agoMake find-function-regexp also find transient-define-*
Jonas Bernoulli [Mon, 19 Feb 2024 22:36:17 +0000 (23:36 +0100)]
Make find-function-regexp also find transient-define-*

* lisp/emacs-lisp/find-func.el (find-function-regexp): Also find
transient-define-prefix, transient-define-suffix,
transient-define-infix and transient-define-argument.

2 years ago; Copyedits
Michael Albinus [Tue, 20 Feb 2024 11:53:15 +0000 (12:53 +0100)]
; Copyedits

2 years agoAdd Tramp methods dockercp and podmancp
Michael Albinus [Tue, 20 Feb 2024 11:52:40 +0000 (12:52 +0100)]
Add Tramp methods dockercp and podmancp

* doc/misc/tramp.texi (External methods):  Add dockercp and podmancp.

* etc/NEWS: Add Tramp methods "dockercp" and "podmancp".

* lisp/net/tramp.el (tramp-handle-make-process):
* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
(tramp-maybe-open-connection):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file)
(tramp-sshfs-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-send-command): Adapt
`tramp-expand-args' calls.

* lisp/net/tramp-container.el (tramp-dockercp-method)
(tramp-podmancp-method): New defconst.
(tramp-methods) <dockercp, podmancp>: Add new methods.
(tramp-container--completion-function): Adapt docstring.  Use it
for "dockercp" and "podmancp" completion.

* lisp/net/tramp.el (tramp-get-remote-tmpdir):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use a default
value with `tramp-get-method-parameter'.

* lisp/net/tramp-sh.el (tramp-methods) <nc>: Add `tramp-copy-file-name'.
(tramp-default-copy-file-name): New defconst.
(tramp-make-copy-file-name): Rename from
`tramp-make-copy-program-file-name'.  Use method parameter
`tramp-copy-file-name'.  (Bug#69085)
(tramp-do-copy-or-rename-file-out-of-band): Adapt callees.

* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-get-method-parameter, tramp-expand-args): New optional
argument DEFAULT.

* test/lisp/net/tramp-tests.el (tramp--test-container-p): Adapt.
(tramp--test-container-oob-p): New defun.
(tramp-test17-dired-with-wildcards, tramp-test35-remote-path)
(tramp-test41-special-characters): Use it.
(tramp--test-set-ert-test-documentation): Use `split-string'.

2 years ago; * doc/misc/gnus.texi (Other modes): Fix last change.
Eli Zaretskii [Mon, 19 Feb 2024 19:34:43 +0000 (21:34 +0200)]
; * doc/misc/gnus.texi (Other modes): Fix last change.

2 years agoAllow attaching files at point using 'gnus-dired-attach'
Philip Kaludercic [Thu, 15 Feb 2024 11:10:12 +0000 (12:10 +0100)]
Allow attaching files at point using 'gnus-dired-attach'

* lisp/gnus/gnus-dired.el (gnus-dired-attach-at-end): Add option.
(gnus-dired-attach): Respect it.
* doc/misc/gnus.texi (Other modes): Document it.  (Bug#69141)

2 years agoSlight switch byte op speedup
Mattias Engdegård [Mon, 19 Feb 2024 13:42:55 +0000 (14:42 +0100)]
Slight switch byte op speedup

* src/bytecode.c (exec_byte_code): Hoist symbols_with_pos_enabled check
from fast loop, and eliminate the initial index check.

2 years agoReplace XSET_HASH_TABLE with make_lisp_hash_table
Mattias Engdegård [Mon, 19 Feb 2024 10:44:53 +0000 (11:44 +0100)]
Replace XSET_HASH_TABLE with make_lisp_hash_table

* src/lisp.h (XSET_HASH_TABLE): Remove, replace with...
(make_lisp_hash_table): ...this.  All callers adapted.

2 years agoCheck shortdoc keywords and fix one mistake
Mattias Engdegård [Mon, 19 Feb 2024 09:27:02 +0000 (10:27 +0100)]
Check shortdoc keywords and fix one mistake

* lisp/emacs-lisp/shortdoc.el (shortdoc--check)
(define-short-documentation-group): Check that used keywords exist.
* lisp/emacs-lisp/shortdoc.el (list): Fix a typo.

2 years ago; Further copyedits of doc/translations/README.
Eli Zaretskii [Mon, 19 Feb 2024 13:19:54 +0000 (15:19 +0200)]
; Further copyedits of doc/translations/README.

2 years ago; Proofreading changes in doc/translations/README.
Jean-Christophe Helary [Mon, 19 Feb 2024 11:05:14 +0000 (20:05 +0900)]
; Proofreading changes in doc/translations/README.

2 years ago* test/src/eval-tests.el (eval-tests/default-value): Add new test case.
Ihor Radchenko [Tue, 2 Jan 2024 11:06:16 +0000 (12:06 +0100)]
* test/src/eval-tests.el (eval-tests/default-value): Add new test case.

Bug#66117

2 years agoDon't update ranges for the whole buffer in treesit--pre-redisplay
Yuan Fu [Mon, 19 Feb 2024 05:39:31 +0000 (21:39 -0800)]
Don't update ranges for the whole buffer in treesit--pre-redisplay

* lisp/treesit.el (treesit--pre-redisplay): Only update two
screen-full of text around point.

2 years agoBack out part of commit db5e84af202
Eric Abrahamsen [Mon, 19 Feb 2024 02:08:51 +0000 (18:08 -0800)]
Back out part of commit db5e84af202

* lisp/gnus/gnus-agent.el (gnus-category-make-function-1): This code is
untested and was not meant to be part of the earlier commit.

2 years agoUse -Wanalyzer-deref-before-check in GCC 14
Paul Eggert [Sun, 18 Feb 2024 08:12:28 +0000 (00:12 -0800)]
Use -Wanalyzer-deref-before-check in GCC 14

* src/marker.c: Work around GCC bug 113253 only if GCC 13.
The GCC bug reportedly will be fixed in GCC 14.

2 years agoDo not ignore -Wanalyzer-allocation-size in GCC 14
Paul Eggert [Sun, 18 Feb 2024 07:48:20 +0000 (23:48 -0800)]
Do not ignore -Wanalyzer-allocation-size in GCC 14

* src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): Use pragma to ignore the
warning only in GCC 13, as the GCC developers say GCC bug 109577
is fixed in GCC 14.

2 years agoRemove no-longer-needed pdumper_load workaround
Paul Eggert [Sun, 18 Feb 2024 07:38:30 +0000 (23:38 -0800)]
Remove no-longer-needed pdumper_load workaround

* src/pdumper.c (pdumper_load): Revert my commit "Pacify GCC
12.1.1 in default developer build" dated 2022-06-13 13:21:18 -07,
as GCC bug 105961 is fixed, and this workaround is not needed for
unfixed GCC as these builds should not use --enable-gcc-warnings.

2 years agoIgnore fewer GCC -fanalyzer diagnostics in ccl.c
Paul Eggert [Sun, 18 Feb 2024 07:12:18 +0000 (23:12 -0800)]
Ignore fewer GCC -fanalyzer diagnostics in ccl.c

* src/ccl.c: Do not ignore -Wanalyzer-use-of-uninitialized-value,
as that bug has been fixed in GCC.  Ignore
-Wanalyzer-out-of-bounds only if GCC 13, as the bug will
reportedly be fixed when GCC 14 comes out.

2 years ago; Fix punctuation and encoding of doc/translations/README
Eli Zaretskii [Sun, 18 Feb 2024 07:56:14 +0000 (09:56 +0200)]
; Fix punctuation and encoding of doc/translations/README

* doc/translations/README: Fix non-ASCII characters and
punctuation.  Add local variables section.

2 years agoMove translations-related files to do/translations/.
Eli Zaretskii [Sun, 18 Feb 2024 07:49:16 +0000 (09:49 +0200)]
Move translations-related files to do/translations/.

2 years agoMove French translations to the top-level doc/ directory.
Jean-Christophe Helary [Sat, 17 Feb 2024 15:02:09 +0000 (00:02 +0900)]
Move French translations to the top-level doc/ directory.

2 years agoAdd README file about translations of Emacs manuals
Jean-Christophe Helary [Sat, 17 Feb 2024 15:04:18 +0000 (00:04 +0900)]
Add README file about translations of Emacs manuals

* doc/README: New file.

2 years agoImplement tooltip_reuse_hidden_frame for Android
Po Lu [Sun, 18 Feb 2024 04:48:41 +0000 (12:48 +0800)]
Implement tooltip_reuse_hidden_frame for Android

* java/org/gnu/emacs/EmacsWindow.java
(findSuitableActivityContext): Return Activity rather than
Context.
(mapWindow): Provide window token manually.

* src/androidfns.c (Fx_show_tip, Fx_hide_tip): Respect
tooltip_reuse_hidden_frame.

2 years agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 17 Feb 2024 23:58:03 +0000 (15:58 -0800)]
Update from Gnulib by running admin/merge-gnulib

2 years agoAdjust to yesterday’s Gnulib nstrftime changes
Paul Eggert [Fri, 16 Feb 2024 02:45:29 +0000 (18:45 -0800)]
Adjust to yesterday’s Gnulib nstrftime changes

Bruno Haible fixed Gnulib so that nstrftime no longer requires
locking code, which means we no longer need to avoid localename.
However, nstrftime now requires localename-unsafe-limited which
pulls in some Gnulib-specific locale code, and it’s likely this
needs to be replaced with Emacs-specific locale code.  In the
meantime let’s continue to finess this by avoiding
localename-unsafe-limited.
* admin/merge-gnulib (AVOIDED_MODULES):
Avoid localename-unsafe-limited instead of localename.

2 years ago; Fix typo from commit 32c5bdfa971
Philip Kaludercic [Sat, 17 Feb 2024 18:20:42 +0000 (19:20 +0100)]
; Fix typo from commit 32c5bdfa971

* lisp/gnus/gnus-util.el (gnus-not-ignore): Quote the argument
to defalias.

2 years agoProvide better default value for date in Gnus scoring
Jakub Ječmínek [Sat, 17 Feb 2024 17:34:36 +0000 (09:34 -0800)]
Provide better default value for date in Gnus scoring

Bug#61002, thanks to Kamil Jońca for reporting

* lisp/gnus/gnus-score.el (gnus-summary-score-entry): When scoring on
Date header, the default value for the prompt should be number of days
between the date of the article under point, and "now".

2 years agoAlias some gnus-specific do-nothing functions
Eric Abrahamsen [Sat, 17 Feb 2024 17:31:50 +0000 (09:31 -0800)]
Alias some gnus-specific do-nothing functions

Replace with #'always and #'ignore

* lisp/gnus/gnus-agent.el: `gnus-agent-true' and `gnus-agent-false'
* lisp/gnus/gnus-util.el: `gnus-not-ignore'

2 years ago; Fix markup in last change (bug#68929).
Eli Zaretskii [Sat, 17 Feb 2024 16:57:12 +0000 (18:57 +0200)]
; Fix markup in last change (bug#68929).

2 years agoAdd manual entries for which-key
Jeremy Bryant [Sun, 11 Feb 2024 21:26:41 +0000 (21:26 +0000)]
Add manual entries for which-key

* doc/emacs/display.texi (Display Custom):  Briefly introduce which-key.
* doc/emacs/help.texi (Key Help):  Briefly mention which-key.

2 years ago; Don't use non-ASCII characters in C comments in xdisp.c.
Eli Zaretskii [Sat, 17 Feb 2024 10:15:11 +0000 (12:15 +0200)]
; Don't use non-ASCII characters in C comments in xdisp.c.

2 years agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 17 Feb 2024 09:54:48 +0000 (04:54 -0500)]
Merge from origin/emacs-29

45f9af61b8e Remove references to phst@google.com.
7256690a3ca * BUGS: Note how to report critical security issues.
1035669b38b Add cross-reference to ELisp manual Caveats
61a14507627 Improve directory prompt used by package-vc-checkout
0c7c8210cb6 Minor Tramp doc adaption
df243f785d4 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
17a395e04c6 ;; Fix typo in the Tramp documentation
614b244a7fa * Improve reproducibility of inferred values by native comp
9f9da26e0dc Handle typescript ts grammar breaking change for function...
717d8c4285f Don't quote 't' in doc strings

2 years ago; Fix last change
Eli Zaretskii [Sat, 17 Feb 2024 09:31:20 +0000 (11:31 +0200)]
; Fix last change

* doc/misc/epa.texi (Cryptographic operations on regions): Fix
wording of the 'epa-keys-select-method's documentation.
* lisp/epa.el (epa-keys-select-method): Doc fix (bug#69133).

2 years agoMake key selection method configurable in EPA.
Aleksandr Vityazev [Thu, 15 Feb 2024 19:51:24 +0000 (22:51 +0300)]
Make key selection method configurable in EPA.

* lisp/epa.el (epa-keys-select-method): New defcustom.
(epa--select-keys-in-minibuffer): New function.
(epa-select-keys): Use new option and function.
* etc/NEWS: Announce it.
* doc/misc/epa.texi (Key Management): Document it.
(Bug#69133)

2 years agoEagerly indent first field in tables in 'lua-ts-mode'
john muhl [Tue, 13 Feb 2024 00:46:51 +0000 (18:46 -0600)]
Eagerly indent first field in tables in 'lua-ts-mode'

* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Properly indent the first field of a table when it appears on a
line by itself.  (Bug#69088)

2 years agoSupport shebang lines with amended environment
Kévin Le Gouguec [Sat, 10 Feb 2024 16:56:57 +0000 (17:56 +0100)]
Support shebang lines with amended environment

For bug#64939.

* lisp/files.el (auto-mode-interpreter-regexp): Account for possible
VARIABLE=[VALUE] operands.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Add an example from the coreutils manual.

2 years agoSupport more complex env invocations in shebang lines
Kévin Le Gouguec [Sat, 10 Feb 2024 16:37:35 +0000 (17:37 +0100)]
Support more complex env invocations in shebang lines

This is not an exact re-implementation of what env accepts, but
hopefully it should be "good enough".

Example of known limitation: we assume that arguments for
--long-options will be set with '=', but that is not
necessarily the case.  '--unset' (mandatory argument) can be
passed as '--unset=VAR' or '--unset VAR', but
'--default-signal' (optional argument) requires an '=' sign.

For bug#64939.

* lisp/files.el (auto-mode-interpreter-regexp): Account for
supplementary arguments passed beside -S/--split-string.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Test some of these combinations.

2 years agoRefine shebang tests (bug#64939)
Kévin Le Gouguec [Sat, 10 Feb 2024 15:14:08 +0000 (16:14 +0100)]
Refine shebang tests (bug#64939)

* test/lisp/files-tests.el (files-tests--check-shebang): For
shell-script modes, verify that the correct shell is set.
(files-tests-auto-mode-interpreter): Prefer 'sh-base-mode' to
'sh-mode' to stay tree-sitter-agnostic; re-organize test cases to
make future ones easier to add.

2 years agoUse modern fallback for channel name detection in ERC
F. Jason Park [Mon, 12 Feb 2024 04:01:54 +0000 (20:01 -0800)]
Use modern fallback for channel name detection in ERC

* lisp/erc/erc-backend.el (erc-query-buffer-p): Remove forward declaration.
* lisp/erc/erc.el (erc-query-buffer-p): Defer to `erc-channel-p'.
(erc-channel-p): Refactor and use `erc--fallback-channel-prefixes' for
the default CHANTYPES value.  Honor an empty CHANTYPES value as valid,
e.g., for servers that only support direct messages.
(erc--fallback-channel-prefixes): New variable to hold fallback
CHANTYPES prefixes recommended by RFC1459 and modern authorities on
the matter.
* test/lisp/erc/erc-tests.el (erc-channel-p): Revise test.  (Bug#67220)

2 years agoNormalize ISUPPORT params with empty values in ERC
F. Jason Park [Mon, 12 Feb 2024 01:15:14 +0000 (17:15 -0800)]
Normalize ISUPPORT params with empty values in ERC

* lisp/erc/erc-backend.el (erc-server-parameters)
(erc--isupport-params): Mention parsing and storage behavior regarding
nonstandard "FOO=" tokens.
(erc--parse-isupport-value): Move comment closer to code.
(erc--get-isupport-entry): Treat the empty string as truly null, as
prescribed by the Brocklesby draft cited in the top-level comment.
* test/lisp/erc/erc-tests.el (erc--get-isupport-entry): Add case for
the empty string appearing as a value for an `erc-server-parameters'
item.
(erc-server-005): Assert compat-related behavior of retaining the
empty string as a valid value from a raw "FOO=" token.
(Bug#67220)

2 years agoIgnore the TGT-LIST parameter in erc-open
F. Jason Park [Mon, 12 Feb 2024 04:42:18 +0000 (20:42 -0800)]
Ignore the TGT-LIST parameter in erc-open

* etc/ERC-NEWS: Mention `erc-open' now ignores TGT-LIST.
* lisp/erc/erc.el (erc-open): Set `erc-default-recipients' to a list
containing only the supplied target.  Other values may cause ERC to
malfunction.  Also redo doc string.

2 years agoMake erc-fill-wrap depend on scrolltobottom
F. Jason Park [Mon, 13 Nov 2023 20:07:36 +0000 (12:07 -0800)]
Make erc-fill-wrap depend on scrolltobottom

* lisp/erc/erc-fill.el (erc-fill-mode): Add reference to
`erc-fill-wrap-mode' in doc string.
(erc--fill-wrap-scrolltobottom-exempt-p): New variable to allow tests
involving `fill-wrap' to opt out of having to enable `scrolltobottom'.
(erc-fill--wrap-ensure-dependencies): Warn and enable
`erc-scrolltobottom-mode' if necessary.
(erc-fill-wrap-mode): Mention workaround for automatically enabling
`scrolltobottom'.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate):
Exempt tests from `scrolltobottom' dependency.
* test/lisp/erc/resources/erc-scenarios-common.el: Load `erc-fill'
when compiling.
(erc-scenarios-common--print-trace): Exempt tests using `fill-wrap'
from the `scrolltobottom' dependency by making
`erc--fill-wrap-scrolltobottom-exempt-p' non-nil during test runs.
(Bug#60936)

2 years agoAutoload custom-loads for new Custom groups in erc.el
F. Jason Park [Sun, 4 Feb 2024 01:17:48 +0000 (17:17 -0800)]
Autoload custom-loads for new Custom groups in erc.el

* lisp/erc/erc.el: Add `custom-loads' library features for group
symbols `erc-spelling' and `erc-imenu' since they aren't defined in
all supported Emacs versions.  Also add groups `erc-sasl' and
`erc-nicks', new libraries recently added to ERC.  Note that this is
unrelated to prefixes generated for the help system.  (Bug#68943)

2 years ago; Load erc-compat before ert-x in ERC tests
F. Jason Park [Fri, 9 Feb 2024 03:19:53 +0000 (19:19 -0800)]
; Load erc-compat before ert-x in ERC tests

Avoid eager macro-expansion error in tests files on Emacs 27 and 28 by
ensuring definitions provided by Compat, like `macroexp-file-name',
load first.

* lisp/erc/erc-speedbar.el (erc-speedbar--reset-last-ran-on-timer):
Suppress "`buffer-local-value' is an obsolete generalized variable"
warning on Emacs 29 and below.
* lisp/erc/erc-stamp.el (erc-stamp--time-as-day): Avoid "unused
lexical variable `current-time-list'" warning on 28 and below.
* lisp/erc/erc.el (erc-check-text-conversion): Add `defvar' for
`text-conversion-style' to avoid "reference to free variable" warning
on Emacs 29 and below.
* test/lisp/erc/erc-button-tests.el: Load `erc-button' before `ert-x'.
* test/lisp/erc/erc-fill-tests.el: Load `erc-fill' before `ert-x'.
* test/lisp/erc/erc-goodies-tests.el: Load `erc-goodies' before
`ert-x'.
* test/lisp/erc/erc-networks-tests.el: Explicitly load `erc-compat'
before anything else.
* test/lisp/erc/erc-scenarios-base-renick.el: Update timeouts.
* test/lisp/erc/erc-stamp-tests.el: Load `erc-stamp' before `ert-x'.
* test/lisp/erc/erc-tests.el: Load `erc-ring' before `ert-x'.

2 years agoRemove "erc-" prefixed Compat definitions
F. Jason Park [Fri, 16 Feb 2024 04:17:20 +0000 (20:17 -0800)]
Remove "erc-" prefixed Compat definitions

* lisp/erc/erc-compat.el: Remove NO-ERROR argument from top-level
`require' for library `compat' because it's guaranteed to be present.
(erc-compat-function, erc-compat-call): Redefine as obsolete aliases
for unprefixed namesakes.
* lisp/erc/erc-fill.el (erc-fill-wrap-nudge): Use `compat-call'
instead of `erc-compat-call'.

2 years ago* java/debug.sh: Print errors correctly if device is ambiguous.
Po Lu [Sat, 17 Feb 2024 02:33:54 +0000 (10:33 +0800)]
* java/debug.sh: Print errors correctly if device is ambiguous.

2 years agoProperly record mtime after insert-file-contents on Android
Po Lu [Sat, 17 Feb 2024 02:27:26 +0000 (10:27 +0800)]
Properly record mtime after insert-file-contents on Android

* src/fileio.c (write_region): Do not verify file identity after
retreiving file status for the second time if st_ino is 0.

2 years ago* src/androidvfs.c (android_scan_directory_tree): Get rid of xstrdup.
Po Lu [Fri, 16 Feb 2024 14:17:01 +0000 (22:17 +0800)]
* src/androidvfs.c (android_scan_directory_tree): Get rid of xstrdup.

2 years ago* lisp/loadup.el (lexical-binding): Add a comment
Stefan Monnier [Fri, 16 Feb 2024 14:04:46 +0000 (09:04 -0500)]
* lisp/loadup.el (lexical-binding): Add a comment

2 years agoWhen deleting output in Eshell, optionally add it to the kill ring.
Tomas Volf [Fri, 16 Feb 2024 02:23:23 +0000 (18:23 -0800)]
When deleting output in Eshell, optionally add it to the kill ring.

* lisp/eshell/esh-mode.el (eshell-kill-output): Rename to...
(eshell-delete-output): ... this, for consistency with 'comint-mode',
and accept KILL argument.  Update callers.

Copyright-paperwork-exempt: yes

2 years agoRemove references to phst@google.com.
Philipp Stephani [Mon, 8 Jan 2024 18:38:33 +0000 (19:38 +0100)]
Remove references to phst@google.com.

I don't work for Google any more, so I'll use my private address going
forward.

* .mailmap: Remove references to phst@google.com.

2 years ago(tex-font-lock-keywords-1): Fix bug#68827
Stefan Monnier [Thu, 15 Feb 2024 20:09:13 +0000 (15:09 -0500)]
(tex-font-lock-keywords-1): Fix bug#68827

* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Don't
apply `tex-verbatim` in comments.

2 years ago; * lisp/emacs-lisp/comp.el (comp--write-bytecode-file): Add comment.
Andrea Corallo [Thu, 15 Feb 2024 18:17:07 +0000 (19:17 +0100)]
; * lisp/emacs-lisp/comp.el (comp--write-bytecode-file): Add comment.

2 years agoproject-or-external-find-regexp: Fix the docstring
Dmitry Gutov [Thu, 15 Feb 2024 17:36:05 +0000 (19:36 +0200)]
project-or-external-find-regexp: Fix the docstring

* lisp/progmodes/project.el (project-or-external-find-regexp):
Fix the docstring (bug#68958).

2 years agoFix the MS-DOS build
Po Lu [Thu, 15 Feb 2024 14:11:14 +0000 (22:11 +0800)]
Fix the MS-DOS build

* configure.ac (REQUIRE_GNUISH_STRFTIME_AM_PM): Move definition
to...

* src/conf_post.h (REQUIRE_GNUISH_STRFTIME_AM_PM):
...conf_post.h.

2 years agoAllow font-spec in 'face-font-rescale-alist' set at startup
Eli Zaretskii [Thu, 15 Feb 2024 10:04:07 +0000 (12:04 +0200)]
Allow font-spec in 'face-font-rescale-alist' set at startup

* lisp/startup.el (startup--rescale-elt-match-p): New function.
(normal-top-level): Use it, instead of the naive 'string-match-p',
to match the default font against the elements of
'face-font-rescale-alist'.  Reported by Rahguzar
<rahguzar@zohomail.eu>.

2 years agoAdd support for reading/writing IELM input history (bug#67000)
Simen Heggestøyl [Tue, 16 Jan 2024 07:21:41 +0000 (08:21 +0100)]
Add support for reading/writing IELM input history (bug#67000)

* lisp/ielm.el (inferior-emacs-lisp-mode): Add support for saving input
history to a file.
(ielm--history-file-name): New variable indicating IELM input history
file.
(ielm--exit): Holds a function to call when Emacs is killed to write
out the input history.
(ielm--input-history-writer): Helper function for writing the IELM
input history out to file.

* lisp/comint.el (comint-input-ring-file-name): Improve defcustom tag.

2 years agoHandle /assets and /content file names in `android-browse-url'
Po Lu [Thu, 15 Feb 2024 06:23:43 +0000 (14:23 +0800)]
Handle /assets and /content file names in `android-browse-url'

* lisp/net/browse-url.el (android-browse-url): New function.

* lisp/term/android-win.el (android-browse-url-internal): Update
function declaration.

* src/androidselect.c (Fandroid_browse_url): Rename to...
(Fandroid_browse_url_internal): ... this.
(syms_of_androidselect): Adjust to match.

2 years agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Thu, 15 Feb 2024 05:18:25 +0000 (21:18 -0800)]
Update from Gnulib by running admin/merge-gnulib

* lib/strftime.c: New file, copied from Gnulib.

2 years agoAdjust to recent Gnulib nstrftime changes
Paul Eggert [Thu, 15 Feb 2024 05:18:25 +0000 (21:18 -0800)]
Adjust to recent Gnulib nstrftime changes

* admin/merge-gnulib (AVOIDED_MODULES): Add localename.
* configure.ac (REQUIRE_GNUISH_STRFTIME_AM_PM): Define.

2 years ago* BUGS: Note how to report critical security issues.
Stefan Kangas [Wed, 14 Feb 2024 23:51:05 +0000 (00:51 +0100)]
* BUGS: Note how to report critical security issues.

2 years agoAdd cross-reference to ELisp manual Caveats
Stefan Kangas [Wed, 14 Feb 2024 23:39:00 +0000 (00:39 +0100)]
Add cross-reference to ELisp manual Caveats

* doc/lispref/intro.texi (Caveats): Add cross-reference to Emacs manual.
Talking about "contributing code" makes little sense in a section about
reporting mistakes in the ELisp manual, so skip that part.